<template>
  <li class="cards_item">
    <div class="card">
      <div class="card_image"><img :src="image"  alt="Card Image"></div>
      <div class="card_content">
        <h2 class="card_title">{{title}}</h2>
        <p class="card_text">{{text}}</p>
        <router-link :to="'/event/' + linkId">
          <button class="btn card_btn" @click="handlerJumpToEvent">Read More</button>
        </router-link>
      </div>
    </div>
  </li>
</template>

<script setup>
import {useRouter} from 'vue-router'
defineProps({
  title: {
    type: String,
    default: 'Card Grid Layout'
  },
  text: {
    type: String,
    default: 'Demo of pixel perfect pure CSS simple responsive card grid layout'
  },
  image: {
    type: String,
    default: 'https://picsum.photos/500/300/?image=10'
  },
  linkId: {
    type: String,
    default: '#'
  }
})
const router = useRouter()
const handlerJumpToEvent=()=>{
  router.push('/event/' + linkId)
}
</script>

<style lang="scss" scoped>


.cards_item {
  display: flex;
  padding: 1rem;
}

@media (min-width: 40rem) {
  .cards_item {
    width: 50%;
  }
}

@media (min-width: 56rem) {
  .cards_item {
    width: 33.3333%;
  }
}

.card {
  background-color: white;
  border-radius: 0.25rem;
  box-shadow: 0 20px 40px -14px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card_content {
  padding: 1rem;
  background: linear-gradient(to bottom left, #EF8D9C 40%, #FFC39E 100%);
}

.card_title {
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: capitalize;
  margin: 0px;
}

.card_text {
  color: #ffffff;
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
  font-weight: 400;
}
.btn {
  color: #ffffff;
  padding: 0.8rem;
  font-size: 14px;
  text-transform: uppercase;
  border-radius: 4px;
  font-weight: 400;
  display: block;
  width: 100%;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
}

.btn:hover {
  background-color: rgba(255, 255, 255, 0.12);
}
</style>